home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
300_01
/
bolt.doc
< prev
next >
Wrap
Text File
|
1989-12-28
|
4KB
|
98 lines
DOCUMENTATION FOR BOLT.C
PURPOSE: To demonstrate a simple MAT_LIB application program. The
program is very short but that is one of the greatest strengths of
MAT_LIB. Relatively powerful programs can be written quickly. This
program is not intended for professional use. Bolt stress is
calculated by dividing the applied load by the net root area. The
program should be examinined only as an illustration of how to use the
MAT_LIB functions.
REFERENCE: None.
GENERAL PROGRAM DESCRIPTION: The user prepares an ASCII text file
contaning the bolt loads, bolt diameters, and the number of bolt threads
per inch. The root area at the base of the threads is computed first and
then the load is divided by the calculated area to determine the bolt
stress. The bolt stress and key input parameters are then directed to
an output file. Comments (such as the column headings) may be included
in the input textfile as long as they are enclosed in curly braces.
Here is an example input file named <INPUT.INP>
{
Sample Tension Bolt Threads
Identifier Load Diameter Per
(lbs) (in) Inch
}
A 1000 0.375 16
B 3000 0.500 13
C 5000 0.625 11
D 9000 0.750 10
The following file is output:
{
BOLT.OUT 6/1/1989
}
{
Sample Area(sq_in) Stress(lbs/sq_in)
}
A 0.0496 20180.3613
B 0.1214 24710.9141
C 0.2182 22912.2207
D 0.3444 26135.6309
USER INTERFACE DESCRIPTION: After creating the input file "BOLT.INP, the
program is executed by entering "BOLT". The program will execute,
calculate the bolt stresses, store the results in BOLT.OUT, and exit to
the operating system. Notice that if a line of data is added the program
will automatically evaluate it and include the results in the output
file.
A. INPUT FILE DESCRIPTION: The ASCII file to be read by BOLT.EXE can
be typed up using a separate text editor. The file must be arranged as
follows:
Data
Line No. Data Description
--------- -------------------------------------------------------------
1 Mark number, tensioin load, bolt diameter, and pitch separated
.. to .. by spaces or tabs.
number of
bolts
NOTE: Lines containing only comments or which are blank
are not counted.
PROGRAM LIMITATIONS: This program is not universally applicable to all
situations encountered. The input file must be named "BOLT.INP" and the
output is always directed to the file named "BOLT.OUT". The MAT_LIB
boundary checking (tck) macro is not used to make sure no calls are made
outside the dynamic text arrays. It is always a good idea to use it at
least for debugging.
VARIABLE DESCRIPTIONS:
rows : Number of data rows
cols : Number of columns in the input file
toksz : Number of characters in the largest input
file token
*FN : The output file identifier
*inp : Input data text array
*out : Output data text array
Net_Area : Bolts root area
Stress : Calculated bolt stress